package com.cheea.associationBss.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Page;

/**
 * 消息的实体
 * @author Administrator
 *
 */
public class Mail extends Model<Mail> {
	public static final Mail dao = new Mail();

	public List<Mail> getMailById(int id) {
		return dao.find("SELECT m.id, (SELECT uname from user u where u.id=m.sendId) as sendName,m.sendId,(SELECT uname from user u where u.id=m.reciveId) as reciveName,m.reciveId,m.content,m.createTime from mail m where m.reciveId=? order by m.createTime desc",id);
	}
}
